import ReactDOM from 'react-dom'
import { Component } from 'react'
import { BrowserRouter as Router, Link, Route } from 'react-router-dom'
import Datail1 from './pages/Datail1'
class App extends Component {
  render() {
    return (
      <Router>
        <div>
          <h1>App组件</h1>
          <ul>
            <li>
              <Link to="/dedai1/1">商品1</Link>
            </li>
            <li>
              <Link to="/dedai1/2">商品2</Link>
            </li>
            <li>
              <Link to="/dedai1/3">商品3</Link>
            </li>
            <li>
              <Link to="/dedai1/4">商品4</Link>
            </li>
          </ul>
          {/* 路由规则 */}
          <Route path="/datai1/:id" component={Datail1}></Route>
        </div>
      </Router>
    )
  }
}
// 渲染组件
ReactDOM.render(<App />, document.getElementById('root'))
